revision:
The property returns the parent node of an element or node. The property is read-only.
Syntax:
element.parentNode or node.parentNode: returns the parent node; "null" if the node has no parent.
property value:
none :
example
The node name of the parent node of "LI" is:
<div>
<ul>
<li id="LI">Coffee</li>
<li>Tea</li>
</ul>
<p>The node name of the parent node of "LI" is: <span id="prop"></span></p>
</div>
<script>
let name = document.getElementById("LI").parentNode.nodeName;
document.getElementById("prop").innerHTML = name;
</script>
click X to close.
<div id="DIV">
<span onclick="this.parentNode.style.display='none';" class="closebtn">X</span>
<p>click X to close.</p>
</div>
<style>
#DIV {box-sizing: border-box; padding: 16px; width: 100%; background-color: red;
color: #fff; font-size: 30px;}
.closebtn {float: right; font-weight: bold; cursor: pointer;}
.closebtn:hover { color: #000;}
</style>